<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
	<%
	String albumuuid = request.getAttribute("albumuuid")==null?"":request.getAttribute("albumuuid").toString();
	String albumname = request.getAttribute("albumname")==null?"":request.getAttribute("albumname").toString();
	%>

	<script language="javascript">
	function popUp(){
			J('#createalbum').dialog({ id: 'd1', title: '创建相册', cover:true,page: '<%=request.getContextPath()%>/album?method=newAlbum', link: true, btns: false, width: 600, height: 450 }); 
	}
    function setzhaopianurl(photoindex){
		//alert(photoindex);
    	var obj = document.getElementById("zhaopianurl"+photoindex);
        var pobj = document.getElementById("myphoto"+photoindex);
		//alert(obj.value=="");
        if(obj.value==""){
        	pobj.src="<%=request.getContextPath()%>/images/no_photo_s.png";
        }else{
           	pobj.src="<%=request.getContextPath()%>/servlet/FileUploadManagerServlet?method=showImage&imgPath="+obj.value;
        }
    }
	
	function _showedit(editindex){
		document.getElementById("editarea_"+editindex).style.display="block";
	}
	function _hideedit(editindex){
		document.getElementById("editarea_"+editindex).style.display="none";
	}
	</script>
    

	<table border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" width="100%">
    
    <tr><td height="30"><a href="<%=request.getContextPath()%>/album" >相册</a> >> <%=albumname%></td></tr>
    <tr>
    	<td height="30">
        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" width="100%">
        <tr id="showaction" style="display:block;"><td height="30" colspan="3">
            <a href="<%=request.getContextPath()%>/album?method=uploadPhoto&albumuuid=<%=albumuuid%>" class="lightBlueNormal12">上传照片</a>&nbsp;&nbsp;
            <a onclick="photomanage();" id="createalbum" class="lightBlueNormal12">管理照片</a>&nbsp;&nbsp;
        </td></tr>
        
        <%
		int photocount = 0;
		%>
        <sap:PhotoList albumuuid="<%=albumuuid%>">
        <%photocount++;%>
        
        <sap:Photo>
        <%
		if(photocount%6==1){
		%>
        <tr>
        	<td width="50">&nbsp;</td>
        <%
		}
		%>
        	<td width="170">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr><td height="10"></td></tr>
            <tr>
            	<td height="110" align="left">
                <input id="zhaopianurl<%=photocount%>" type="hidden" value="<sap:write property='PI_SMALLIMAGE' />">
                <table border="0" cellpadding="0" cellspacing="1" height="110" width="112" bgcolor="#CCCCCC">
                <tr>
                	<td width="100%" height="100%" bgcolor="#FFFFFF" align="left" valign="middle"><a href="<%=request.getContextPath()%>/album?method=albumPhotoScroll&albumuuid=<%=albumuuid%>"><img id="myphoto<%=photocount%>" name="myphoto<%=photocount%>" savePath="" alt="" width="100" height="100" src="" style="border: 0px; border-color:#CCCCCC;" /></a>
                	</td>
                </tr>
                </table>
                <script language="javascript">
                <!--
                setzhaopianurl("<%=photocount%>");
                -->
                </script> 
                </td>
            </tr>
            <tr>
            	<td height="20" class="lightBlueNormal12" align="left" valign="bottom"><sap:write property="PA_NAME" /></td>
            </tr>
            </table>
            </td>
        <%
		if(photocount%6==0){
		%>
        </tr>
        <tr><td height="20"></td></tr>
        <%
		}
		%>
        
        </sap:Photo>
        </sap:PhotoList>
        <%
		if(photocount>0 && photocount%6!=0){
			for(int i=photocount%6;i<=6;i++){
		%>
        	<td width="170"></td>
        <%
			}
		%>
        </tr>
        <%
		}
		%>
        <%if(photocount==0){%>
        <tr>
            	<td height="110" align="left" colspan="2">
                <table border="0" cellpadding="0" cellspacing="1" height="400" width="100%" bgcolor="#CCCCCC">
                <tr>
                	<td width="100%" height="100%" bgcolor="#FFFFFF" align="center" valign="middle">
                	该相册尚未上传照片
                	</td>
                </tr>
                </table>
                </td>
        </tr>
        
        <%}%>
        </table>
        </td>
    </tr>
    </table>
    
    